package com.cspm.ahjy.bc.office.word.domain;

public class MSItem {

	private String itemType = "";//项目符号或项目编号：符号“symbol”，编号“number”
	private Integer location = 0;//符号或编号在Word中的位置，1－7有效
	private String description = "无";//符号或编号的位置描述
	
	private Integer ilvl = 0;//默认都为0
	private Integer ilfo = 0;//没有实际意义
	private String text = "";//对应符号
	private String font = "";//符号字体
	
	public MSItem(){
		
	}
	
	/**
	 * 构造方法
	 * @param ilfo 不能为null
	 * @param text 可为null
	 */
	public MSItem(Integer ilfo, String text){
		this.ilfo = ilfo;
		if (text != null) {
			this.text = text;
			switch (text) {
			//项目符号
			case "l":
				this.itemType = "symbol";
				this.location = 1;
				this.description = "第一行第2个";
				break;
			case "n":
				this.itemType = "symbol";
				this.location = 2;
				this.description = "第一行第3个";
				break;
			case "u":
				this.itemType = "symbol";
				this.location = 3;
				this.description = "第一行第4个";
				break;
			case "ü":
				this.itemType = "symbol";
				this.location = 5;
				this.description = "第二行第2个";
				break;
			case "Ø":
				this.itemType = "symbol";
				this.location = 6;
				this.description = "第二行第3个";
				break;
			case "²":
				this.itemType = "symbol";
				this.location = 7;
				this.description = "第二行第4个";
				break;
			//项目编号
			case "1.":
				this.itemType = "number";
				this.location = 1;
				this.description = "第一行第2个";
				break;
			case "1)":
				this.itemType = "number";
				this.location = 2;
				this.description = "第一行第3个";
				break;
			case "一、":
				this.itemType = "number";
				this.location = 3;
				this.description = "第一行第4个";
				break;
			case "A.":
				this.itemType = "number";
				this.location = 4;
				this.description = "第二行第1个";
				break;
			case "(一)":
				this.itemType = "number";
				this.location = 5;
				this.description = "第二行第2个";
				break;
			case "a)":
				this.itemType = "number";
				this.location = 6;
				this.description = "第二行第3个";
				break;
			case "i.":
				this.itemType = "number";
				this.location = 7;
				this.description = "第二行第4个";
				break;

			default:
				break;
			}
		}else {
			this.itemType = "symbol";
			this.location = 4;
			this.description = "第二行第1个";
		}
	}
	
	public Boolean equals(MSItem item){
		if (null == item) {
			return Boolean.FALSE;
		}
		String itemType2 = item.getItemType();
		Integer location2 = item.getLocation();
		if (this.itemType.equals(itemType2) && this.location.equals(location2)) {
			return Boolean.TRUE;
		}
		return Boolean.FALSE;
	}

	public String getFont() {
		return font;
	}

	public void setFont(String font) {
		this.font = font;
	}

	public String getItemType() {
		return itemType;
	}

	public Integer getLocation() {
		return location;
	}

	public String getDescription() {
		return description;
	}

	public Integer getIlvl() {
		return ilvl;
	}

	public Integer getIlfo() {
		return ilfo;
	}

	public String getText() {
		return text;
	}
	
}
